package com.zhongwang.mms.module.material.dao;

import com.zhongwang.mms.gen.entity.MOrderDetail;
import com.zhongwang.mms.gen.entity.MOrderDetailExample;
import com.zhongwang.mms.module.material.model.MOrderDetailModel;
import com.zhongwang.mms.module.material.model.MProCodeQueryModel;
import com.zhongwang.mms.module.material.model.MProject;
import com.zhongwang.mms.module.overview.model.ProjectStatusModel;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MOrderDetailDao {
    long countByExample(MOrderDetailExample example);

    int deleteByExample(MOrderDetailExample example);

    int deleteByPrimaryKey(Integer odaId);

    int insert(MOrderDetail record);

    int insertSelective(MOrderDetail record);

    List<MOrderDetail> selectByExample(MOrderDetailExample example);

    MOrderDetail selectByPrimaryKey(Integer odaId);

    int updateByExampleSelective(@Param("record") MOrderDetail record, @Param("example") MOrderDetailExample example);

    int updateByExample(@Param("record") MOrderDetail record, @Param("example") MOrderDetailExample example);

    int updateByPrimaryKeySelective(MOrderDetail record);

    int updateByPrimaryKey(MOrderDetail record);

    /*--myself--*/

    /**
     * 查询出入库单明细信息
     *
     * @param odrId 主单Id
     * @return
     */
    List<MOrderDetailModel> findOrderDetailByPrimaryKey(Integer odrId);

    /**
     * 取得项目信息
     *
     * @param param 根据项目号
     * @return
     */
    List<ProjectStatusModel> findProjectByCode(MProCodeQueryModel param);

    /**
     * 根据项目编号取得项目信息
     *
     * @param proCode
     * @return
     */
    MProject findProjectByProCode(String proCode);


    int selectCountDetailByOdaIds(List<Integer> arr);

    int selectDetailCountByRepCode(List<Integer> arr);

    int selectDetailInCountByRepCode(List<Integer> arr);
    /**
     * 根据项目编号取得项目信息
     *
     * @param proCode
     * @return
     */
    MProject findProjectBySALEProCode(String proCode);
}